package com.neo.base.C04_keyVlueOperator.C04_02_pairTest


import org.apache.spark.SparkConf
import org.apache.spark.SparkContext

import org.slf4j.LoggerFactory
import com.typesafe.scalalogging.slf4j.Logger


object CreatePair {
  val logger = Logger(LoggerFactory.getLogger("CreatePair"))


  def main(args: Array[String]): Unit = {

    val conf = new SparkConf().setMaster("local[8]").setAppName("CreatePair")
    val sc = new SparkContext(conf)

    val lines = sc.parallelize(List("ap ple as","asd bala nla","ora nge asd"))


    val  pair1 = lines.map(x => (x.split(" ")(0), x))

    pair1.take(10).foreach(println)
    println("*\n*\n*\n*\n*\n*\n*\n*\n*\n*\n")
    logger.info(pair1.toString())



  }

}
